home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BMUG Revelations
/
BMUG Revelations.toast
/
Programming
/
Programming Languages
/
Yerk 3.64
/
Float source
/
elCode
next >
Wrap
Text File
|
1990-12-22
|
3KB
|
143 lines
\ interface to SANE transcendentals package 5
\ 9/20/85 cbd Version 1.0
\ 1/24/86 gdc Debugged Compound and Annuity
:CODE ln \ natural log
move.l (a7),d0
pea 2(a3,d0.l)
clr.w -(a7)
call pack5
;CODE
:CODE log2
move.l (a7),d0
pea 2(a3,d0.l)
move.w #2,-(a7)
call pack5
;CODE
:CODE ln1
move.l (a7),d0
pea 2(a3,d0.l)
move.w #4,-(a7)
call pack5
;CODE
:CODE log21
move.l (a7),d0
pea 2(a3,d0.l)
move.w #6,-(a7)
call pack5
;CODE
:CODE exp
move.l (a7),d0
pea 2(a3,d0.l)
move.w #8,-(a7)
call pack5
;CODE
:CODE exp2
move.l (a7),d0
pea 2(a3,d0.l)
move.w #10,-(a7)
call pack5
;CODE
:CODE exp1
move.l (a7),d0
pea 2(a3,d0.l)
move.w #12,-(a7)
call pack5
;CODE
:CODE exp21
move.l (a7),d0
pea 2(a3,d0.l)
move.w #14,-(a7)
call pack5
;CODE
\ ( x y -- x**y) general exponentiation - takes 2 floats
:CODE x**y
move.l (A7)+,D0 ; get 2 floats in D0,D1
move.l (A7)+,D1 ;
pea 2(A3,D0.l) ; push abs data addresses
pea 2(A3,D1.l)
move.l YERK[(fltDisp)],d7 ; get subr addr in d7
jsr 0(a3,d7.l) ; go kill
move.w #32786,-(a7)
call pack5
move.l d1,-(a7)
;CODE
( rate #periods -- compound_interest)
:CODE compound
move.l YERK[(fltNew)],d7 ; get subr addr in d7
jsr 0(a3,d7.l) ; get new float for destination
move.l D1,D2 ; move address of destination to D2
move.l (A7)+,D0 ; src2
move.l (A7)+,D1 ; src1
pea 2(A3,D1.l) ; push abs data addresses
pea 2(A3,D0.l)
pea 2(A3,D2.l)
move.l YERK[(fltDisp2)],d7 ; get subr addr in d7
jsr 0(a3,d7.l) ; go kill src,src2
move.w #49172,-(a7)
call pack5
move.l d2,-(a7)
;CODE
( rate #periods -- annuity)
:CODE annuity
move.l YERK[(fltNew)],d7 ; get subr addr in d7
jsr 0(a3,d7.l) ; get new float for destination
move.l D1,D2 ; move address of destination to D2
move.l (A7)+,D0 ; src2
move.l (A7)+,D1 ; src1
pea 2(A3,D1.l) ; push abs data addresses
pea 2(A3,D0.l)
pea 2(A3,D2.l)
move.l YERK[(fltDisp2)],d7 ; get subr addr in d7
jsr 0(a3,d7.l) ; go kill src,src2
move.w #49174,-(a7)
call pack5
move.l d2,-(a7)
;CODE
:CODE sin
move.l (a7),d0
pea 2(a3,d0.l)
move.w #24,-(a7)
call pack5
;CODE
:CODE cos
move.l (a7),d0
pea 2(a3,d0.l)
move.w #26,-(a7)
call pack5
;CODE
:CODE tan
move.l (a7),d0
pea 2(a3,d0.l)
move.w #28,-(a7)
call pack5
;CODE
:CODE arcTan
move.l (a7),d0
pea 2(a3,d0.l)
move.w #30,-(a7)
call pack5
;CODE
\ floating-pt random number routine
:CODE fRand
move.l (a7),d0
pea 2(a3,d0.l)
move.w #32,-(a7)
call pack5
;CODE